home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 31 / Amiga Format CD31 (1998-09-02)(Future Publishing)(GB)(Track 1 of 2)[!][issue 1998-10].iso / -coverdisks- / 115a / ppt / rexx / antiquetint.prx next >
Text File  |  1998-07-29  |  2KB  |  70 lines

  1. /*
  2.     AntiqueTint: Makes the image have a tint like in the old
  3.     photographs.  If the original image is in greyscale, then this
  4.     will turn it into an RGB image.
  5.  
  6.     by Janne Jalkanen 1997.
  7.  
  8.     $Id: AntiqueTint.prx 1.2 1998/06/29 20:50:43 jj Exp jj $
  9. */
  10.  
  11. /*-------------------------------------------------------------------*/
  12. /*  I suggest you use this header as-is and add your own code below  */
  13.  
  14. OPTIONS RESULTS
  15. SIGNAL ON ERROR
  16. IF ADDRESS() = REXX THEN DO
  17.     startedfromcli = 1
  18.     ADDRESS PPT
  19. END
  20. ELSE DO
  21.     startedfromcli = 0
  22.     ADDRESS PPT
  23. END
  24. RESULT = 'no result'
  25.  
  26. /*-------------------------------------------------------------------*/
  27. /* Main code. */
  28.  
  29. PARSE ARG frame
  30.  
  31. IF DATATYPE(frame) ~= NUM THEN DO
  32.     RC  = 10
  33.     RC2 = "No frame selected"
  34.     SIGNAL ERROR
  35. END
  36.  
  37. FRAMEINFO frame STEM myinfo
  38.  
  39. /*
  40.  *  If the original image is greyscale, then we will convert it into
  41.  *  truecolor before we can apply the antique tint effect
  42.  */
  43.  
  44. IF myinfo.COLORSPACE = "Greyscale" THEN DO
  45.         PROCESS frame TRUECOLOR
  46. END
  47.  
  48. /*
  49.  *  Let's apply the transformation.  This will simulate the aging
  50.  *  effect which makes the red color withstand the passage of time.
  51.  */
  52.  
  53. PROCESS frame COLORMIX RED "1.0,0,0" GREEN "0,0.84,0" BLUE "0,0,0.68"
  54.  
  55. EXIT 0
  56.  
  57. /*-------------------------------------------------------------------*/
  58. /* Again, keep this part intact. This is the error handler. */
  59. ERROR :
  60. returncode = RC
  61. IF startedfromcli = 1 THEN DO
  62.     SAY 'ERROR ' returncode ' on line ' SIGL ': ' RC2
  63.     PPT_TO_BACK
  64. END
  65. ELSE
  66.     SHOWERROR '"'RC2'"' SIGL
  67. EXIT returncode
  68.  
  69.  
  70.